package com.eastfair.certificate.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 人员库
 * </p>
 *
 * @author ligang
 * @since 2023-03-08
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "cert_people", autoResultMap = true)
@ApiModel(value = "People", description = "人员库")
@AllArgsConstructor
public class People extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 身份证（正面）
     */
    @ApiModelProperty(value = "身份证（正面）")
    @Size(max = 255, message = "身份证（正面）长度不能超过255")
    @TableField(value = "card_front", condition = LIKE)
    @Excel(name = "身份证（正面）")
    private String cardFront;

    /**
     * 身份证（反面）
     */
    @ApiModelProperty(value = "身份证（反面）")
    @Size(max = 255, message = "身份证（反面）长度不能超过255")
    @TableField(value = "card_back", condition = LIKE)
    @Excel(name = "身份证（反面）")
    private String cardBack;

    /**
     * 主体类型  主运，搭建商，参展商
     */
    @ApiModelProperty(value = " 主体类型  主运，搭建商，参展商")
    @Size(max = 255, message = " 主体类型  主运，搭建商，参展商长度不能超过255")
    @TableField(value = "principal_type", condition = LIKE)
    @Excel(name = " 主体类型  主运，搭建商，参展商")
    private String principalType;

    /**
     * 身份证号码
     */
    @ApiModelProperty(value = "身份证号码")
    @Size(max = 255, message = "身份证号码长度不能超过255")
    @TableField(value = "card_number", typeHandler = M9EncryptHandler.class)
    @Excel(name = "身份证号码")
    private String cardNumber;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    @Size(max = 255, message = "姓名长度不能超过255")
    @TableField(value = "full_name", condition = LIKE)
    @Excel(name = "姓名")
    private String fullName;

    /**
     * 公司名称
     */
    @ApiModelProperty(value = "公司名称")
    @Size(max = 255, message = "公司名称长度不能超过255")
    @TableField(value = "company_name", condition = LIKE)
    @Excel(name = "公司名称")
    private String companyName;

    /**
     * 公司id
     */
    @ApiModelProperty(value = "公司id")
    @TableField(value = "company_id")
    @Excel(name = "公司id")
    private Long companyId;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    @Size(max = 255, message = "性别长度不能超过255")
    @TableField(value = "gender", condition = LIKE)
    @Excel(name = "性别")
    private String gender;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @Size(max = 255, message = "联系方式长度不能超过255")
    @TableField(value = "contact_information", typeHandler = M9EncryptHandler.class)
    @Excel(name = "联系方式")
    private String contactInformation;

    /**
     * 工种高空作业证电工证其他
     */
    @ApiModelProperty(value = "工种高空作业证电工证其他")
    @Size(max = 255, message = "工种高空作业证电工证其他长度不能超过255")
    @TableField(value = "work_type", condition = LIKE)
    @Excel(name = "工种高空作业证电工证其他")
    private String workType;

    /**
     * 工作证件照
     */
    @ApiModelProperty(value = "工作证件照")
    @Size(max = 255, message = "工作证件照长度不能超过255")
    @TableField(value = "work_certificate_img", condition = LIKE)
    @Excel(name = "工作证件照")
    private String workCertificateImg;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 团队id
     */
    @ApiModelProperty(value = "团队id")
    @TableField(value = "team_id")
    @Excel(name = "团队id")
    private Long teamId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 是否可用，1是；0否
     */
    @ApiModelProperty(value = "是否可用，1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否可用，1是；0否")
    private Integer isEnabled;


    @Builder
    public People(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime,
                  String cardFront, String cardBack, String principalType, String cardNumber, String fullName,
                  String companyName, Long companyId, String gender, String contactInformation, String workType, String workCertificateImg,
                  Integer isDeleted, Long tenantId, Long projectId, Long teamId, Long subsystemId, Integer isEnabled) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.cardFront = cardFront;
        this.cardBack = cardBack;
        this.principalType = principalType;
        this.cardNumber = cardNumber;
        this.fullName = fullName;
        this.companyName = companyName;
        this.companyId = companyId;
        this.gender = gender;
        this.contactInformation = contactInformation;
        this.workType = workType;
        this.workCertificateImg = workCertificateImg;
        this.isDeleted = isDeleted;
        this.tenantId = tenantId;
        this.projectId = projectId;
        this.teamId = teamId;
        this.subsystemId = subsystemId;
        this.isEnabled = isEnabled;
    }

}
